package com.yb.login.center.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.yb.core.constant.HttpConstant;
import com.yb.core.util.RegExpUtil;
import com.yb.login.center.validate.group.mobile.GetVerityCode;
import com.yb.login.center.validate.group.mobile.ValidateVerifyCode;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * Copyright (C), 2022-2022, 姚兵
 * Author: 32210
 * Date: 2022/11/12 22:12
 * FileName: LoginVo
 * Description:
 */


@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LoginVo {
    private String username;
    private String password;

    @Pattern(regexp = RegExpUtil.MOBILE_PATTERN,message = HttpConstant.MOBILE_PATTERN_ERROR,groups = {GetVerityCode.class, ValidateVerifyCode.class})
    @NotBlank(message = HttpConstant.MOBILE_ERROR,groups = {GetVerityCode.class,ValidateVerifyCode.class})
    private String mobile;

    @NotBlank(message = "验证码不能为空",groups = {ValidateVerifyCode.class})
    private String verifyCode;//验证码

    private Integer type;//0 用户密码，1手机号

    private String imgUUID;
}
